package com.fbinggun.fattribute.effect;

import com.fbinggun.fattribute.attribute.IAttribute;
import com.fbinggun.fattribute.data.EntityData;
import org.bukkit.event.entity.EntityDamageByEntityEvent;

import java.util.Map;

public class FrightenEffect extends IEffect{


    public FrightenEffect(int duration, double modification, EntityData source) {
        super(duration, modification, source);
    }

    @Override
    public void tick(EntityData entityData) {

    }

    public Map<IAttribute,Double> modifyDamage(EntityData entityData, Map<IAttribute,Double> map, EntityDamageByEntityEvent event){
        event.setDamage(Math.max(0,event.getDamage()-modification));
        return map;
    }
}
